#define timer_Variable

#include "userDef.h"

void TimerOnOff(void) // called per 1s
{
    if (l_timerOn.set != 0 || l_timerOff.set != 0)
    {
        TimerActSec++;

        if (TimerActSec >= Norm60Fast02)
        {
            TimerActSec = 0;

            if (l_timerOn.set > 0)
            {
                l_timerOn.set--;

                if (l_timerOn.set == 0)
                {
                    set_power(ON);
                    f_eepRomChg = 1;

#ifdef CTRL_485
                    update_wireCtrl = 2;
#endif
                }
            }

            if (l_timerOff.set > 0)
            {
                l_timerOff.set--;

                if (l_timerOff.set == 0)
                {
                    set_power(OFF);

                    f_eepRomChg = 1;

#ifdef CTRL_485
                    update_wireCtrl = 2;
#endif
                }
            }

            // SET(f_upd_timer_left);
        }
    }
}
